<html>
<head><meta charset="utf-8"><title>optimizing matches · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html">optimizing matches</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211721927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211721927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211721927">(Sep 30 2020 at 06:56)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/77355">#77355</a></p>
<p><code>if matches!(..)</code> currently results in two branches, one setting a local to true or false and the second one actually branching on that local, what would be <del>the best</del> <em>a good</em> way to optimize this (and probably also <code>if !matches!(...)</code>)?</p>



<a name="211724041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211724041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211724041">(Sep 30 2020 at 07:26)</a>:</h4>
<p>Have you tried with mir opt level 2 or 3? I'm almost certain I reviewed a PR that fixes this</p>



<a name="211724332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211724332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211724332">(Sep 30 2020 at 07:30)</a>:</h4>
<p><code>-Zmir-opt-level=3</code></p>



<a name="211724372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211724372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211724372">(Sep 30 2020 at 07:30)</a>:</h4>
<p><a href="https://godbolt.org/z/8K79o8">https://godbolt.org/z/8K79o8</a></p>



<a name="211725564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211725564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211725564">(Sep 30 2020 at 07:46)</a>:</h4>
<p>hmm... I'm searching for that PR now</p>



<a name="211725802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211725802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211725802">(Sep 30 2020 at 07:48)</a>:</h4>
<p>aaah, it works with <code>matches!(num, Foo::B)</code> but not with `matches!(num, Foo::B | Foo::C)</p>



<a name="211727071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211727071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211727071">(Sep 30 2020 at 08:06)</a>:</h4>
<p>what opt pass is responsible here?</p>



<a name="211727084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211727084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211727084">(Sep 30 2020 at 08:06)</a>:</h4>
<p>and how easy is it to extend that to group match arms with identical targets together</p>



<a name="211727633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211727633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211727633">(Sep 30 2020 at 08:13)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir/src/transform/match_branches.rs">https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir/src/transform/match_branches.rs</a></p>



<a name="211727669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211727669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211727669">(Sep 30 2020 at 08:13)</a>:</h4>
<p>should be fairly easy to adjust by just checking whether there are only two destinations in the switch targets, even if there are multiple conditions</p>



<a name="211727692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211727692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211727692">(Sep 30 2020 at 08:13)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/c0127e4dbf3a9d3a67ddb1da19f8441019aab8f8/compiler/rustc_mir/src/transform/match_branches.rs#L51">https://github.com/rust-lang/rust/blob/c0127e4dbf3a9d3a67ddb1da19f8441019aab8f8/compiler/rustc_mir/src/transform/match_branches.rs#L51</a> is very conservative</p>



<a name="211728373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728373">(Sep 30 2020 at 08:20)</a>:</h4>
<p>So my initial idea was to replace <code>bb1</code> with <code>bb4</code> and <code>bb2</code> with <code>bb5</code></p>



<a name="211728503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728503">(Sep 30 2020 at 08:22)</a>:</h4>
<p>extending what we are currently doing in <code>match_branches</code> would mean that we use</p>
<div class="codehilite"><pre><span></span><code>_temp1 = Eq(move _3, const 1);
_temp2 = Eq(move_3, const 2);
_2 = BinOr(move _temp1, move _temp2);
</code></pre></div>



<a name="211728697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728697">(Sep 30 2020 at 08:24)</a>:</h4>
<p>uh</p>



<a name="211728701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728701">(Sep 30 2020 at 08:24)</a>:</h4>
<p>why would it mean that?</p>



<a name="211728831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728831">(Sep 30 2020 at 08:26)</a>:</h4>
<p>oh</p>



<a name="211728843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728843">(Sep 30 2020 at 08:26)</a>:</h4>
<p>the current code is already buggy, isn't it</p>



<a name="211728875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728875">(Sep 30 2020 at 08:26)</a>:</h4>
<p>I don't think it's buggy <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> why do you think that?</p>



<a name="211728880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728880">(Sep 30 2020 at 08:26)</a>:</h4>
<p>it will mis-optimize if the const bool assignment is used within the same block and not just for the switch</p>



<a name="211728918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728918">(Sep 30 2020 at 08:27)</a>:</h4>
<p>but it only allows const bool assignments in these blocks</p>



<a name="211728932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728932">(Sep 30 2020 at 08:27)</a>:</h4>
<p>doesn't it?</p>



<a name="211728936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728936">(Sep 30 2020 at 08:27)</a>:</h4>
<p>nope, it allows any kind of 100% equal statement in those blocks, too</p>



<a name="211728941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728941">(Sep 30 2020 at 08:27)</a>:</h4>
<p>and moves them around</p>



<a name="211728999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211728999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211728999">(Sep 30 2020 at 08:28)</a>:</h4>
<p>not sure if we have any code where that generality is necessary for though</p>



<a name="211729013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729013">(Sep 30 2020 at 08:28)</a>:</h4>
<p>but isn't that still fine, as we keep the assignments in order?</p>



<a name="211729073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729073">(Sep 30 2020 at 08:29)</a>:</h4>
<p>yea, but we remove the assignment from the bool</p>



<a name="211729103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729103">(Sep 30 2020 at 08:29)</a>:</h4>
<p>so if we had <code>_temp = const true;</code> in one block and <code>_temp = const false</code> in the other and <code>_x = _temp</code> in both, then that would now read from an uninit variable</p>



<a name="211729189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729189">(Sep 30 2020 at 08:30)</a>:</h4>
<p>won't this add<br>
_temp = Eq(_branch_var, branch_int)</p>



<a name="211729194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729194">(Sep 30 2020 at 08:30)</a>:</h4>
<p>anyway, this is easy to solve, we just bail out on anything but a <code>_temp = const X;</code> in that block, as we don't have an example that actually uses it</p>



<a name="211729197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729197">(Sep 30 2020 at 08:30)</a>:</h4>
<p>which initializes temp</p>



<a name="211729205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729205">(Sep 30 2020 at 08:30)</a>:</h4>
<p>sure but then you need the or-logic and everything, too</p>



<a name="211729250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729250">(Sep 30 2020 at 08:30)</a>:</h4>
<p>(for your example with multiple variants)</p>



<a name="211729267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729267">(Sep 30 2020 at 08:31)</a>:</h4>
<p>let's simplify first to things we actually have unit tests for</p>



<a name="211729287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729287">(Sep 30 2020 at 08:31)</a>:</h4>
<p>or... let my try to manually generate such code</p>



<a name="211729302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729302">(Sep 30 2020 at 08:31)</a>:</h4>
<p>still a bit confused</p>



<a name="211729304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729304">(Sep 30 2020 at 08:31)</a>:</h4>
<p>one moment</p>



<a name="211729328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729328">(Sep 30 2020 at 08:32)</a>:</h4>
<p>does the current implementation result in incorrect code?</p>



<a name="211729351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729351">(Sep 30 2020 at 08:32)</a>:</h4>
<p>trying to build a miscompilation on nightly</p>



<a name="211729367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211729367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211729367">(Sep 30 2020 at 08:32)</a>:</h4>
<p>it does under very weird circumstances</p>



<a name="211731542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211731542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211731542">(Sep 30 2020 at 08:55)</a>:</h4>
<p>hmm... we have too many optimizations interacting here: <a href="https://godbolt.org/z/GcYPeT">https://godbolt.org/z/GcYPeT</a></p>



<a name="211731555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211731555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211731555">(Sep 30 2020 at 08:55)</a>:</h4>
<p>I can't get it to miscompile</p>



<a name="211731962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211731962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211731962">(Sep 30 2020 at 08:59)</a>:</h4>
<p>can you write out the mir which would get misoptimized directly?</p>



<a name="211736979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211736979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211736979">(Sep 30 2020 at 09:48)</a>:</h4>
<p>I believe <a href="https://gist.github.com/oli-obk/2c703799342217ea8b9dbc596e08ee6b">https://gist.github.com/oli-obk/2c703799342217ea8b9dbc596e08ee6b</a> will get misoptimized</p>



<a name="211737459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211737459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211737459">(Sep 30 2020 at 09:54)</a>:</h4>
<p>is it important to use <code>switchInt(move _3) -&gt; [1_isize: bb2, 2_isize: bb2, otherwise: bb1];</code> here,<br>
or would <code>switchInt(move _3) -&gt; [1_isize: bb2, otherwise: bb1];</code> also work?</p>



<a name="211737720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211737720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211737720">(Sep 30 2020 at 09:57)</a>:</h4>
<p>for the simpler switch (which we optimize rn), this would get optimized to the following, wouldn't it?</p>
<div class="codehilite"><pre><span></span><code>bb0: {
        StorageLive(_2);                 // scope 0 at /rustc/381b445ff5751f9f39ec672b623372dff09c276e/library/core/src/macros/mod.rs:246:9: 249:10
        _3 = discriminant(_1);           // scope 0 at ./example.rs:11:22: 11:28
        _2 = Eq(move _3, const 1);
        _4 = _2 as i32;
        goto -&gt; bb3;
    }
</code></pre></div>



<a name="211737732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211737732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211737732">(Sep 30 2020 at 09:57)</a>:</h4>
<p>which seems correct to me</p>



<a name="211758064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758064">(Sep 30 2020 at 13:23)</a>:</h4>
<p>yea, we need that switch, otherwise you're ignoring the <code>| Foo::C</code> and only doing the body if <code>Foo::B</code></p>



<a name="211758116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758116">(Sep 30 2020 at 13:24)</a>:</h4>
<p>your example specifically uses <code>Foo::B | Foo::C</code></p>



<a name="211758184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758184">(Sep 30 2020 at 13:24)</a>:</h4>
<p>so you need 3 branches, one for <code>B</code> one for <code>C</code> (going to the same block) and one for everything else</p>



<a name="211758354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758354">(Sep 30 2020 at 13:25)</a>:</h4>
<p>oh wait, you're asking if the <code>matches!(foo, Foo::B)</code> also misoptimizes, yes</p>



<a name="211758475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758475">(Sep 30 2020 at 13:26)</a>:</h4>
<p>that's a slightly different problem, but the same issue essentially</p>



<a name="211758691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758691">(Sep 30 2020 at 13:28)</a>:</h4>
<p>oh yea</p>



<a name="211758700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758700">(Sep 30 2020 at 13:28)</a>:</h4>
<p>no misoptimization, you're right</p>



<a name="211758723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758723">(Sep 30 2020 at 13:28)</a>:</h4>
<p>I forgot about the <code>Eq</code> being inserted</p>



<a name="211758759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758759">(Sep 30 2020 at 13:28)</a>:</h4>
<p>I thought we were forwarding directly to the switch, but that is <em>another</em> optimization <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="211758781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758781">(Sep 30 2020 at 13:28)</a>:</h4>
<p>so if we reorder opts, the <code>Eq</code> would disappear again</p>



<a name="211758798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758798">(Sep 30 2020 at 13:28)</a>:</h4>
<p>(which we should totally do)</p>



<a name="211758999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211758999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211758999">(Sep 30 2020 at 13:30)</a>:</h4>
<p>do we opt <code>_temp = (a == 3) || (a == 4); switchInt(_temp)</code> to a branch on a directly</p>



<a name="211759016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759016">(Sep 30 2020 at 13:30)</a>:</h4>
<p>probably not <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="211759056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759056">(Sep 30 2020 at 13:30)</a>:</h4>
<p>nope</p>



<a name="211759073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759073">(Sep 30 2020 at 13:30)</a>:</h4>
<p>but we can tune the optimization to start handling chains</p>



<a name="211759129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759129">(Sep 30 2020 at 13:31)</a>:</h4>
<p>so we probably still have suboptimal code for matches with multiple variants here, even if we extend <code>match_branches</code> to insert bitors</p>



<a name="211759567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759567">(Sep 30 2020 at 13:34)</a>:</h4>
<p>yes</p>



<a name="211759586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759586">(Sep 30 2020 at 13:34)</a>:</h4>
<p>but less suboptimal</p>



<a name="211759597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759597">(Sep 30 2020 at 13:34)</a>:</h4>
<p>and with a path forward for fixing it</p>



<a name="211759656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759656">(Sep 30 2020 at 13:35)</a>:</h4>
<blockquote>
<p>but we can tune the optimization to start handling chains</p>
</blockquote>
<p>what exactly do you mean with that?</p>



<a name="211759874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759874">(Sep 30 2020 at 13:37)</a>:</h4>
<p><code>SimplifyComparisonIntegral</code> optimizes <code>_x = Eq(_y, 42); switchInt(_x, [false =&gt; bb1, otherwise =&gt; bb2])</code> to <code>switchInt(_y, [42 =&gt; bb2, otherwise =&gt; bb1])</code></p>



<a name="211759947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759947">(Sep 30 2020 at 13:37)</a>:</h4>
<p>we could teach that optimization about the multi-eq chained by <code>Or</code> situation</p>



<a name="211759955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211759955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211759955">(Sep 30 2020 at 13:37)</a>:</h4>
<p>are you planning on working on this or can I look into mentoring someone in doing it?</p>



<a name="211760344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211760344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211760344">(Sep 30 2020 at 13:40)</a>:</h4>
<p>feel free to mentor someone else <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> while I would be interested in working on this myself I don't think I actually have the time to do so rn</p>



<a name="211760633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/211760633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#211760633">(Sep 30 2020 at 13:42)</a>:</h4>
<p>heh, gotcha</p>



<a name="212941318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/212941318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jknodt <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#212941318">(Oct 11 2020 at 00:23)</a>:</h4>
<p>Sorry for digging up an older thread, but for the miscompilation, I believe there were some subsequent PRs after the initial implementation that corrected the errors</p>



<a name="212954269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/212954269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#212954269">(Oct 11 2020 at 07:54)</a>:</h4>
<p>There were also hypothetical miscompiles. Not sure if we fixed those, too.</p>



<a name="212954271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/optimizing%20matches/near/212954271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/optimizing.20matches.html#212954271">(Oct 11 2020 at 07:54)</a>:</h4>
<p>I need to reread the opt before being able to give you reliable info</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>